package com.gxuwz.restaurant.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gxuwz.restaurant.common.Result;
import com.gxuwz.restaurant.entity.Menu;
import com.gxuwz.restaurant.mapper.MenuMapper;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    MenuMapper menuMapper;

    @GetMapping("/showMenu")   //get用来查询
    public Result<?> showMenu(
                              @RequestParam String role) {

        QueryWrapper<Menu> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("menuhead", role);
        List<Menu> menus = menuMapper.selectList(queryWrapper);

        return Result.success(menus);

    }



}